home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
wsc4vb24
/
errors16.bas
< prev
next >
Wrap
BASIC Source File
|
1999-05-31
|
1KB
|
43 lines
'
' ERRORS16.BAS
'
Option Explicit
DefInt A-Z
Function GetErrorText(ByVal ErrorCode As Integer) As String
Select Case ErrorCode
Case IE_BADID
GetErrorText = "Invalid COM port name"
Case IE_OPEN
GetErrorText = "COM port already open"
Case IE_NOPEN
GetErrorText = "Cannot open COM port"
Case IE_MEMORY
GetErrorText = "Unable to allocate memory"
Case IE_DEFAULT
GetErrorText = "Error in default parameters"
Case IE_HARDWARE
GetErrorText = "Hardware not present"
Case IE_BYTESIZE
GetErrorText = "Unsupported byte size"
Case IE_BAUDRATE
GetErrorText = "Unsupported baud rate"
Case WSC_NO_DATA
GetErrorText = "No data"
Case WSC_RANGE
GetErrorText = "Parameter out of range"
Case WSC_ABORTED
GetErrorText = "Shareware version corrupted"
Case Else
GetErrorText = "Error code " + Str$(ErrorCode)
End Select
End Function
Sub SayError(F As Form, ByVal ErrorCode)
F.Print GetErrorText(ErrorCode)
End Sub